﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AIFSCMSClient
{
    public class FactExpressionPredicate : IExpressionPredicate
    {
        Queue<string> buffer;

        public Queue<string> Buffer
        {
            get
            {
                if (buffer == null)
                    buffer = new Queue<string>();

                return buffer;
            }
            set { buffer = value; }
        }

        private CriteriaBuilderResult<FactExpressionPredicate> Create(string Oper, string Value)
        {
            Buffer.Enqueue(Oper);
            Buffer.Enqueue(Value);

            CriteriaBuilderResult<FactExpressionPredicate> result = new CriteriaBuilderResult<FactExpressionPredicate>(Buffer);
            return result;
        }

        public CriteriaBuilderResult<FactExpressionPredicate> IsEqualTo(string value)
        {
            return Create("=", value);
        }

        public CriteriaBuilderResult<FactExpressionPredicate> IsNull()
        {
            return Create("=", "NULL");
        }
    }
}
